/**********************************************************************************
 * Copyright (c) 2012 - 2012,  parallel, All right reserved
 * Title: com.adc.parallel.constants  ConfigConstants.java 
 * @author shen  shenqiao2012@163.com 
 *  2012-11-23 上午10:20:54 
 *********************************************************************************/


package com.adc.parallel.constants;

import java.util.Properties;

import com.adc.quicktools.PropertiesUtil;


/**
 * 
 * Description: define config constants 
 * @author shen  shenqiao2012@163.com
 */
public class ConfigConstants {
	/**
	 * the global config properties
	 */
	private static Properties Config;
	/**
	 *  max pool size
	 */
	public final static String CFG_KEY_PoolSize="maxPoolSize";
	/**
	 * per executor thread process time 
	 */
	public final static String CFG_KEY_PerExecutorTime="perExecutorTime";
	/**
	 * the time gap between twice that push receive list to wait list
	 */
	public final static String CFG_KEY_ReceiveTime="pushReceiveTime";
	/**
	 * the time gap between twice that clear completed list which had been writen in log
	 */
	public final static String CFG_KEY_ClearCompletedTime="clearCompletedTime";
	/**
	 * the time gap of persistent 
	 */
	public final static String CFG_KEY_PersistentCycle="persistentCycle";
	/**
	 * the max alive time of persistent
	 */
	public final static String CFG_KEY_PersistentMaxAliveTime="persistentMaxAliveTime";
	/**
	 * the time gap of main thread sleep
	 */
	public final static String CFG_KEY_MainSleepTime="mainSleepTime";
	/**
	 * @return the config
	 */
	public static Properties getConfig() {
		if (Config==null||Config.size()==0) {
			Config=PropertiesUtil.loadProperties(SysConstants.getConfigName());
		}
		return Config;
	}

}
